<?php
class Forum_Controller_Request
{
    public function getActionName()
    {
        $route = (empty($_GET['route'])) ? '' : $_GET['route'];
    
        $action = 'index';
        
        if (!empty($route)) {
            $parts = explode('/', $route);
            if (!@class_exists($parts[0] . 'Controller')) {
                $action = $parts[0];
            } elseif (isset($parts[1]) && !empty($parts[1])) {
                $action = $parts[1];
            }
        }
        
        return $action;
    }
    
    public function getControllerName()
    {
        $route = (empty($_GET['route'])) ? '' : $_GET['route'];
    
        $controller = 'index';
        
        if (!empty($route)) {
            $parts = explode('/', $route);
            if (@class_exists(ucfirst($parts[0]) . 'Controller')) {
                $controller = $parts[0];
            }
        }
        
        return $controller;
    }
}